//
//  Qb_AppConfig.h
//  Cd_Qb
//
//  Created by mac on 2018/2/6.
//  Copyright © 2018年 mac. All rights reserved.
//

#ifndef Qb_AppConfig_h
#define Qb_AppConfig_h

//bolck使用 避免循环引用
#define WS(weakSelf)  __weak __typeof(&*self)weakSelf = self;
#define WEAKSELF typeof(self) __weak weakSelf = self;


//请求数据分页大小
#define PAGESIZE 8

#define iphone6P (ScreenH == 736)
#define iphone6 (ScreenH == 667)
#define iphone5 (ScreenH == 568)
#define iphone4 (ScreenH == 480)

// iPhone X

#define kDevice_Is_iPhoneX (([[UIApplication sharedApplication] statusBarFrame].size.height)>=44)
#define kStatusBarBottom [[UIApplication sharedApplication] statusBarFrame].size.height

#define NavBarHeight                     (kDevice_Is_iPhoneX?88.0f:64.0f)
#define TabbarHeight                     (kDevice_Is_iPhoneX?83.0f:49.0f)
#define kDistancebottom                   (kDevice_Is_iPhoneX?34.0f:0.0f)

#define UserToken @"fe1d41a18dda43522b93eccd737de777"

#define KDM_iPhoneX ( ScreenW == 375.f && ScreenH == 812.f ? YES : NO)

#define KD_iPhoneX ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) : NO)
#define KDMScreenStatusBarHeight [[UIApplication sharedApplication] statusBarFrame].size.height
#define KDMScreenNavigationBarHeight 44.f
#define KDMScreenTopStatusNaviHeight KDMScreenStatusBarHeight + KDMScreenNavigationBarHeight
#define KDMScreenTabBarHeight  KD_iPhoneX ? (49+34):49
/**
 // MARK: 安全区底部高度
 */
#define KDMScreenTabBarSafeBottomMargin (KD_iPhoneX ? 34.f : 0.f)

/**
 //商城token  bvjhsajhvbhjjhvhjwbvhjbhbvb
 外卖token  sadUserTokenda
 */

//#pragma mark  ================ 定义全局常量类 ==================
///** 导航条最大的Y值 */
//const NSInteger XQbaxNavY = 64;
///** 标题栏的高度 */
//const NSInteger XWTitleViewH = 35;
///** tabBar的高度 */
//const NSInteger XWTabBarH = 49;
///** tabbar底部安全区 */
//const NSInteger XWTabBarBottomSecH = 34;
///** 通用间隔 */
//const NSInteger XQbargin = 10;


/**
 * 云脉OCR 身份证云识别API 账号 密码
 */

#define YUNMAI_OCR_USERNAME @"17d6dcbe-03d8-41cd-b1fb-138f0f189689"
#define YUNMAI_OCR_PASSWORD @"WASiVCyBRVoVXqmsMfqMMTnXLJPrXB"


/** 适配字体大小 */
#define RemindFont(x,y,z) (ScreenW == 320?(x):ScreenW == 375? (y):(z))
/** 适配字体大小 */
#define FontSize(x,y,z) [UIFont systemFontOfSize:RemindFont(x,y,z)]

#define ScreenH [UIScreen mainScreen].bounds.size.height
#define ScreenW [UIScreen mainScreen].bounds.size.width

/** 图片赋值 */
#define MyImage(imageName) [UIImage imageNamed:imageName]

/** 适配比例 */
#define AdaptiveScale_W (ScreenW/375.0)
#define AdaptiveScale_H (ScreenH/667.0)

//屏幕比例
#define     kColorRGB(R,G,B,A) [UIColor colorWithRed:(R)/255.0f green:(G)/255.0f blue:(B)/255.0f alpha:(A)]
#define     AdFont(font) [UIFont systemFontOfSize:font*AdaptiveScale_W]
#endif /* Qb_AppConfig_h */

#define Inline static inline

Inline UIViewController *Storyboard(NSString *name,NSString*Identifier){
    return [[UIStoryboard storyboardWithName:name bundle:[NSBundle mainBundle]] instantiateViewControllerWithIdentifier:Identifier];
}

Inline NSArray *loadNibNamed(NSString *name){
    return [[NSBundle mainBundle]loadNibNamed:name owner:nil options:nil];
}


